/*
 * RadioStreamerStats.h
 *
 *  Created on: Dec 19, 2011
 *      Author: shaohong
 */

#ifndef RADIOSTREAMERSTATS_H_
#define RADIOSTREAMERSTATS_H_

#include <list>
#include <utility>
#include <time.h>

#include "RadioChannel.h"

using namespace std;

namespace nmps {

class RadioStreamerStats {
public:
	RadioStreamerStats(RadioChannel * radioChannel);
	virtual ~RadioStreamerStats();

	void setRadioChannel(RadioChannel * radioChannel);

	void markFirstHttpRequestSent();
	void markTranscodedAudioReady();
	void markStationStopTime();

	void increaseMp3FramesReceived();
	void increasePcmFramesCreated();

//	void saveRecipientList(list< pair<string, int>  >& recipientList);
//
	void initialize();

	string toString();

	volatile bool transcodedReady;


private:
	RadioChannel * radioChannel;
	unsigned long mp3FramesReceived;
	unsigned long pcmFramesSent;


	struct timeval firstHttpRequestSentTime;
	struct timeval firstRtpSentTime;
	struct timeval streamingStopTime;

//	string recpientList;

};

} /* namespace nmps */
#endif /* RADIOSTREAMERSTATS_H_ */
